/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Jorge
 */
@Entity
@Table(name = "alumnocarrera")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Alumnocarrera.findAll", query = "SELECT a FROM Alumnocarrera a"),
    @NamedQuery(name = "Alumnocarrera.findByClaveUnicaAlumno", query = "SELECT a FROM Alumnocarrera a WHERE a.alumnocarreraPK.claveUnicaAlumno = :claveUnicaAlumno"),
    @NamedQuery(name = "Alumnocarrera.findByClaveCarrera", query = "SELECT a FROM Alumnocarrera a WHERE a.alumnocarreraPK.claveCarrera = :claveCarrera")})
public class Alumnocarrera implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected AlumnocarreraPK alumnocarreraPK;

    public Alumnocarrera() {
    }

    public Alumnocarrera(AlumnocarreraPK alumnocarreraPK) {
        this.alumnocarreraPK = alumnocarreraPK;
    }

    public Alumnocarrera(int claveUnicaAlumno, String claveCarrera) {
        this.alumnocarreraPK = new AlumnocarreraPK(claveUnicaAlumno, claveCarrera);
    }

    public AlumnocarreraPK getAlumnocarreraPK() {
        return alumnocarreraPK;
    }

    public void setAlumnocarreraPK(AlumnocarreraPK alumnocarreraPK) {
        this.alumnocarreraPK = alumnocarreraPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (alumnocarreraPK != null ? alumnocarreraPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Alumnocarrera)) {
            return false;
        }
        Alumnocarrera other = (Alumnocarrera) object;
        if ((this.alumnocarreraPK == null && other.alumnocarreraPK != null) || (this.alumnocarreraPK != null && !this.alumnocarreraPK.equals(other.alumnocarreraPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Alumnocarrera[ alumnocarreraPK=" + alumnocarreraPK + " ]";
    }
    
}
